package mao.thinkinjava.io.preference;

import java.util.prefs.Preferences;

/**
 * preference保存用户的偏好信息。
 */
public class PreferenceDemo {
    public static void main(String[] args) {
        Preferences prefs = Preferences.userNodeForPackage(PreferenceDemo.class);
        String name = "mao";
        prefs.put("name",name);
       // prefs.put
        String names = prefs.get("name", name);
        System.out.println(name);

    }
}
